1 /* 2 3 Boost Software License - Version 1.0 - August 17th, 2003 4 5 Permission is hereby granted, free of charge, to any person or organization 6 obtaining a copy of the software and accompanying documentation covered by 7 this license (the "Software") to use, reproduce, display, distribute, 8 execute, and transmit the Software, and to prepare derivative works of the 9 Software, and to permit third-parties to whom the Software is furnished to 10 do so, all subject to the following: 11 12 The copyright notices in the Software and this entire statement, including 13 the above license grant, this restriction and the following disclaimer, 14 must be included in all copies of the Software, in whole or in part, and 15 all derivative works of the Software, unless such copies or derivative 16 works are solely in the form of machine-executable object code generated by 17 a source language processor. 18 19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 DEALINGS IN THE SOFTWARE. 26 27 */ 28 29 module derelict.purple.server; 30 31 import derelict.glib.gtypes; 32 import derelict.glib.glibconfig; 33 import derelict.glib.ghash; 34 import derelict.purple.blist; 35 import derelict.purple.connection; 36 import derelict.purple.conversation; 37 import derelict.purple.prpl; 38 import derelict.purple.account; 39 import core.stdc.time; 40 41 extern (C): 42 43 44 version(Derelict_Link_Static) 45 { 46 extern( C ) nothrow 47 { 48 uint serv_send_typing(PurpleConnection* gc, const(char)* name, PurpleTypingState state); 49 void serv_move_buddy(PurpleBuddy*, PurpleGroup*, PurpleGroup*); 50 int serv_send_im(PurpleConnection*, const(char)*, const(char)*, PurpleMessageFlags flags); 51 PurpleAttentionType* purple_get_attention_type_from_code(PurpleAccount* account, guint type_code); 52 void serv_send_attention(PurpleConnection* gc, const(char)* who, guint type_code); 53 void serv_got_attention(PurpleConnection* gc, const(char)* who, guint type_code); 54 void serv_get_info(PurpleConnection*, const(char)*); 55 void serv_set_info(PurpleConnection*, const(char)*); 56 void serv_add_permit(PurpleConnection*, const(char)*); 57 void serv_add_deny(PurpleConnection*, const(char)*); 58 void serv_rem_permit(PurpleConnection*, const(char)*); 59 void serv_rem_deny(PurpleConnection*, const(char)*); 60 void serv_set_permit_deny(PurpleConnection*); 61 void serv_chat_invite(PurpleConnection*, int, const(char)*, const(char)*); 62 void serv_chat_leave(PurpleConnection*, int); 63 void serv_chat_whisper(PurpleConnection*, int, const(char)*, const(char)*); 64 int serv_chat_send(PurpleConnection*, int, const(char)*, PurpleMessageFlags flags); 65 void serv_alias_buddy(PurpleBuddy*); 66 void serv_got_alias(PurpleConnection* gc, const(char)* who, const(char)* alias_); 67 void purple_serv_got_private_alias(PurpleConnection* gc, const(char)* who, const(char)* alias_); 68 void serv_got_typing(PurpleConnection* gc, const(char)* name, int timeout, PurpleTypingState state); 69 void serv_got_typing_stopped(PurpleConnection* gc, const(char)* name); 70 void serv_got_im(PurpleConnection* gc, const(char)* who, const(char)* msg, PurpleMessageFlags flags, time_t mtime); 71 void serv_join_chat(PurpleConnection*, GHashTable* data); 72 void serv_reject_chat(PurpleConnection*, GHashTable* data); 73 void serv_got_chat_invite(PurpleConnection* gc, const(char)* name, const(char)* who, const(char)* message, GHashTable* data); 74 PurpleConversation* serv_got_joined_chat(PurpleConnection* gc, int id, const(char)* name); 75 void purple_serv_got_join_chat_failed(PurpleConnection* gc, GHashTable* data); 76 void serv_got_chat_left(PurpleConnection* g, int id); 77 void serv_got_chat_in(PurpleConnection* g, int id, const(char)* who, PurpleMessageFlags flags, const(char)* message, time_t mtime); 78 void serv_send_file(PurpleConnection* gc, const(char)* who, const(char)* file); 79 } 80 } 81 else 82 { 83 extern( C ) nothrow 84 { 85 alias da_serv_send_typing = uint function(PurpleConnection* gc, const(char)* name, PurpleTypingState state); 86 alias da_serv_move_buddy = void function(PurpleBuddy*, PurpleGroup*, PurpleGroup*); 87 alias da_serv_send_im = int function(PurpleConnection*, const(char)*, const(char)*, PurpleMessageFlags flags); 88 alias da_purple_get_attention_type_from_code = PurpleAttentionType* function(PurpleAccount* account, guint type_code); 89 alias da_serv_send_attention = void function(PurpleConnection* gc, const(char)* who, guint type_code); 90 alias da_serv_got_attention = void function(PurpleConnection* gc, const(char)* who, guint type_code); 91 alias da_serv_get_info = void function(PurpleConnection*, const(char)*); 92 alias da_serv_set_info = void function(PurpleConnection*, const(char)*); 93 alias da_serv_add_permit = void function(PurpleConnection*, const(char)*); 94 alias da_serv_add_deny = void function(PurpleConnection*, const(char)*); 95 alias da_serv_rem_permit = void function(PurpleConnection*, const(char)*); 96 alias da_serv_rem_deny = void function(PurpleConnection*, const(char)*); 97 alias da_serv_set_permit_deny = void function(PurpleConnection*); 98 alias da_serv_chat_invite = void function(PurpleConnection*, int, const(char)*, const(char)*); 99 alias da_serv_chat_leave = void function(PurpleConnection*, int); 100 alias da_serv_chat_whisper = void function(PurpleConnection*, int, const(char)*, const(char)*); 101 alias da_serv_chat_send = int function(PurpleConnection*, int, const(char)*, PurpleMessageFlags flags); 102 alias da_serv_alias_buddy = void function(PurpleBuddy*); 103 alias da_serv_got_alias = void function(PurpleConnection* gc, const(char)* who, const(char)* alias_); 104 alias da_purple_serv_got_private_alias = void function(PurpleConnection* gc, const(char)* who, const(char)* alias_); 105 alias da_serv_got_typing = void function(PurpleConnection* gc, const(char)* name, int timeout, PurpleTypingState state); 106 alias da_serv_got_typing_stopped = void function(PurpleConnection* gc, const(char)* name); 107 alias da_serv_got_im = void function(PurpleConnection* gc, const(char)* who, const(char)* msg, PurpleMessageFlags flags, time_t mtime); 108 alias da_serv_join_chat = void function(PurpleConnection*, GHashTable* data); 109 alias da_serv_reject_chat = void function(PurpleConnection*, GHashTable* data); 110 alias da_serv_got_chat_invite = void function(PurpleConnection* gc, const(char)* name, const(char)* who, const(char)* message, GHashTable* data); 111 alias da_serv_got_joined_chat = PurpleConversation* function(PurpleConnection* gc, int id, const(char)* name); 112 alias da_purple_serv_got_join_chat_failed = void function(PurpleConnection* gc, GHashTable* data); 113 alias da_serv_got_chat_left = void function(PurpleConnection* g, int id); 114 alias da_serv_got_chat_in = void function(PurpleConnection* g, int id, const(char)* who, PurpleMessageFlags flags, const(char)* message, time_t mtime); 115 alias da_serv_send_file = void function(PurpleConnection* gc, const(char)* who, const(char)* file); 116 } 117 118 __gshared 119 { 120 da_serv_send_typing serv_send_typing; 121 da_serv_move_buddy serv_move_buddy; 122 da_serv_send_im serv_send_im; 123 da_purple_get_attention_type_from_code purple_get_attention_type_from_code; 124 da_serv_send_attention serv_send_attention; 125 da_serv_got_attention serv_got_attention; 126 da_serv_get_info serv_get_info; 127 da_serv_set_info serv_set_info; 128 da_serv_add_permit serv_add_permit; 129 da_serv_add_deny serv_add_deny; 130 da_serv_rem_permit serv_rem_permit; 131 da_serv_rem_deny serv_rem_deny; 132 da_serv_set_permit_deny serv_set_permit_deny; 133 da_serv_chat_invite serv_chat_invite; 134 da_serv_chat_leave serv_chat_leave; 135 da_serv_chat_whisper serv_chat_whisper; 136 da_serv_chat_send serv_chat_send; 137 da_serv_alias_buddy serv_alias_buddy; 138 da_serv_got_alias serv_got_alias; 139 da_purple_serv_got_private_alias purple_serv_got_private_alias; 140 da_serv_got_typing serv_got_typing; 141 da_serv_got_typing_stopped serv_got_typing_stopped; 142 da_serv_got_im serv_got_im; 143 da_serv_join_chat serv_join_chat; 144 da_serv_reject_chat serv_reject_chat; 145 da_serv_got_chat_invite serv_got_chat_invite; 146 da_serv_got_joined_chat serv_got_joined_chat; 147 da_purple_serv_got_join_chat_failed purple_serv_got_join_chat_failed; 148 da_serv_got_chat_left serv_got_chat_left; 149 da_serv_got_chat_in serv_got_chat_in; 150 da_serv_send_file serv_send_file; 151 } 152 }